package com.zys.el.user.service.Impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.zys.el.core.service.impl.CrudServiceImpl;
import com.zys.el.user.po.FieldMenu;
import com.zys.el.user.service.IFieldMenuService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class FieldMenuServiceImpl extends CrudServiceImpl<FieldMenu> implements IFieldMenuService {
    @Override
    public List<FieldMenu> getFieldMenuByFieldId(Long fieldId) {
        QueryWrapper<FieldMenu> qw = new QueryWrapper<>();
        qw.eq("field_id_", fieldId);
        return getBaseMapper().selectList(qw);
    }

    @Override
    public List<FieldMenu> getFieldMenuByParentId(Long parentId) {
        QueryWrapper<FieldMenu> qw = new QueryWrapper<>();
        qw.eq("parent_id_", parentId);
        return getBaseMapper().selectList(qw);
    }
}
